home *** CD-ROM | disk | FTP | other *** search
/ Essentials of Interactive Physiology / Essentials of Interactive Physiology.iso / pc / files / evaluation / evaluationWinIE.dcr / 00007_quizParentoriginal.ls < prev    next >
Encoding:
Text File  |  2002-04-02  |  18.4 KB  |  550 lines

  1. property poDotMan, pkMaxDigits, poPrev, poTop, poNext, ploAnswerButtons, poPopUp, poRightQuestions, poWrongQuestions, poOwner, poTestAnswer, poChapterBtnGroup, plQuestionOrder, plAnswerOrder, psChapterQuestions, plRightWrong, piNumQuestions, piNumQuestionsAvailable, piNumChapters, piCurChapter, piCurQuestion, piNumAnswers, piCorrectAnswer, piTotalCorrect, piResponseSprites, plQuestionsAnswerOrder, plFirstAnswer, pzEvalType, pliTestChapters, plpTestQuestions, plTestQuestionOrder, piCurChapterQuestion, piNumTestQuestonsAnswered
  2. global gsArtCastLib
  3.  
  4. on new me, xoDotMan, xInfo
  5.   poDotMan = xoDotMan
  6.   mInitVars(me, xInfo)
  7.   if not voidp(getaProp(xInfo, #whichChapter)) then
  8.     piCurChapter = integer(getaProp(xInfo, #whichChapter))
  9.     mHandleTopBtnClick(me, #start_quiz)
  10.   else
  11.     mInitSprites(me)
  12.   end if
  13.   return me
  14. end
  15.  
  16. on mInitVars me, xInfo
  17.   piNumQuestions = getaProp(xInfo, #numQuestions)
  18.   piNumQuestionsAvailable = getaProp(xInfo, #numAvailable)
  19.   piNumChapters = getaProp(xInfo, #numChapters)
  20.   pzEvalType = getProp(xInfo, #evalType)
  21.   poOwner = getaProp(xInfo, #owner)
  22.   piNumAnswers = 4
  23.   pkMaxDigits = 2
  24.   pliTestChapters = []
  25. end
  26.  
  27. on mInitSprites me
  28.   mResetDots(poDotMan)
  29.   mInitBkg(me, string(pzEvalType) & "BG")
  30.   mInitButtons(me, "start" & string(pzEvalType))
  31.   mSetState(poTop, #gray)
  32.   mDisable(poTop, 1)
  33.   if pzEvalType = #quiz then
  34.     mInitChapterSelectionBtns(me, "Radio")
  35.   else
  36.     mInitChapterSelectionBtns(me, "Toggle")
  37.     mInitNumQuestionsRadio(me)
  38.   end if
  39. end
  40.  
  41. on mInitBkg me, xsMember
  42.   viSprite = mGiveDot(poDotMan)
  43.   set the member of sprite viSprite to xsMember
  44. end
  45.  
  46. on mInitButtons me, xsMemberTop, xsMemberPrev, xsMemberNext
  47.   viSprite = mGiveDot(poDotMan)
  48.   vzTop = symbol(xsMemberTop)
  49.   if not voidp(xsMemberTop) then
  50.     poTop = InitPopBtn(me, viSprite, xsMemberTop, #mTopBtnClick, vzTop, "clickSnd")
  51.   end if
  52.   if not voidp(xsMemberPrev) then
  53.     viSprite = mGiveDot(poDotMan)
  54.     poPrev = InitPopBtn(me, viSprite, xsMemberPrev, #mPrevBtnClick, VOID, "clickSnd")
  55.     viSprite = mGiveDot(poDotMan)
  56.     poNext = InitPopBtn(me, viSprite, xsMemberNext, #mNextBtnClick, VOID, "clickSnd")
  57.   end if
  58. end
  59.  
  60. on mInitChapterSelectionBtns me, vsButtonType
  61.   vsMember = string(pzEvalType) & "Circle"
  62.   poChapterBtnGroup = new(script("BtnGroupWLabelParent"), vsButtonType, vsMember, "chapterSpacer", "chapterLabel", poDotMan, piNumChapters, pkMaxDigits)
  63.   mSetOwner(poChapterBtnGroup, me)
  64.   mSetEvent(poChapterBtnGroup, #chapterSelectionClick)
  65. end
  66.  
  67. on mInitNumQuestionsRadio me
  68.   poPopUp = new(script("BtnGroupWLabelParent"), "Radio", "TestCircle", "NumQuestionRadioSpacer", "QuestionLabel", poDotMan, 5, pkMaxDigits)
  69.   mSetOwner(poPopUp, me)
  70.   mSetEvent(poPopUp, #numQuestionsRadioBtn)
  71.   mDisable(poPopUp, 0)
  72.   mDepressABtn(poPopUp, 1)
  73. end
  74.  
  75. on mInitReviewQuestionBtns me
  76.   viSprite = mGiveDots(poDotMan, piNumQuestions)
  77.   repeat with i = 1 to piNumQuestions
  78.     vsResult = getAt(plRightWrong, i)
  79.     AlignCenteredSpriteToMember(viSprite + i - 1, "chapSpacer" & IntegerToString(i, pkMaxDigits))
  80.     voQuestionButton = new(script("NotifyOwnerParent"), viSprite + i - 1, vsResult)
  81.     mSetMyOwnerMyEventMyID(voQuestionButton, me, #questionReview, i)
  82.     set the cursor of sprite (viSprite + i - 1) to 280
  83.     add(the scriptInstanceList of sprite (viSprite + i - 1), voQuestionButton)
  84.   end repeat
  85. end
  86.  
  87. on mInitReviewScrollText me
  88.   viSprite = mGiveDots(poDotMan, 2)
  89.   if the text of field "testRightScroll" = EMPTY then
  90.     vsWrong = EMPTY
  91.     vsRight = EMPTY
  92.     repeat with i = 1 to piNumQuestions
  93.       vsResult = getAt(plRightWrong, i)
  94.       vsLine = "Question " & string(i) & " - Chapter " & string(getPropAt(plpTestQuestions, i))
  95.       if vsResult = "right" then
  96.         vsRight = vsRight & RETURN & vsLine
  97.         next repeat
  98.       end if
  99.       vsWrong = vsWrong & RETURN & vsLine
  100.     end repeat
  101.     delete line 1 of vsRight
  102.     delete line 1 of vsWrong
  103.     member("testWrongScroll").text = vsWrong
  104.     member("testRightScroll").text = vsRight
  105.   end if
  106.   AlignTextBoxToSpacer(viSprite, "testRightSpacer")
  107.   AlignTextBoxToSpacer(viSprite + 1, "testWrongSpacer")
  108.   set the member of sprite viSprite to "testRightScroll"
  109.   set the member of sprite (viSprite + 1) to "testWrongScroll"
  110.   if voidp(poRightQuestions) then
  111.     poRightQuestions = new(script("listParent"), viSprite, "testRightScroll", me, 1)
  112.     poWrongQuestions = new(script("listParent"), viSprite + 1, "testWrongScroll", me, 2)
  113.   end if
  114.   add(the scriptInstanceList of sprite viSprite, poRightQuestions)
  115.   add(the scriptInstanceList of sprite (viSprite + 1), poWrongQuestions)
  116.   add(the actorList, poRightQuestions)
  117.   add(the actorList, poWrongQuestions)
  118.   mShow(poRightQuestions)
  119.   mShow(poWrongQuestions)
  120. end
  121.  
  122. on mInitLetters me
  123.   viSprite = mGiveDots(poDotMan, piNumAnswers)
  124.   if pzEvalType = #quiz then
  125.     ploAnswerButtons = []
  126.     repeat with i = 1 to piNumAnswers
  127.       voAnswerButton = new(script("ToggleBtnParent"), viSprite + i - 1, string(pzEvalType) & IntegerToString(i, pkMaxDigits))
  128.       add(the scriptInstanceList of sprite (viSprite + i - 1), voAnswerButton)
  129.       mSetMyOwnerMyEventMyID(voAnswerButton, me, #answerClick, i)
  130.       append(ploAnswerButtons, voAnswerButton)
  131.     end repeat
  132.   else
  133.     vlbuttons = []
  134.     repeat with i = 1 to piNumAnswers
  135.       vlAbuttonInfo = [#sprite: viSprite + i - 1, #name: string(pzEvalType) & IntegerToString(i, pkMaxDigits), #ID: i]
  136.       add(vlbuttons, vlAbuttonInfo)
  137.     end repeat
  138.     poTestAnswer = new(script("RadioGroupParent"), vlbuttons, #none)
  139.     mSetOwner(poTestAnswer, me)
  140.     mSetEvent(poTestAnswer, #testAnswer)
  141.     mDisable(poTestAnswer, 0)
  142.   end if
  143.   piResponseSprites = mGiveDots(poDotMan, piNumAnswers)
  144. end
  145.  
  146. on mInitNumberFields me
  147.   viSprite = mGiveDot(poDotMan)
  148.   set the member of sprite viSprite to "question_num"
  149.   member("question_num").text = string(piCurQuestion)
  150.   AlignTextBoxToSpacer(viSprite, "QuestNumSpacer")
  151.   set the ink of sprite viSprite to 36
  152.   viSprite = mGiveDot(poDotMan)
  153.   member("total_questions").text = string(piNumQuestions)
  154.   set the member of sprite viSprite to "total_questions"
  155.   AlignTextBoxToSpacer(viSprite, "NumQuestSpacer")
  156.   set the ink of sprite viSprite to 36
  157.   if pzEvalType = #quiz then
  158.     viSprite = mGiveDot(poDotMan)
  159.     member("total_correct").text = string(piTotalCorrect)
  160.     set the member of sprite viSprite to "total_correct"
  161.     AlignTextBoxToSpacer(viSprite, "NumCorrectSpacer")
  162.     set the ink of sprite viSprite to 36
  163.   end if
  164. end
  165.  
  166. on mInitTextFields me
  167.   vsQuestionData = line getAt(plQuestionOrder, piCurChapterQuestion) of psChapterQuestions
  168.   vsOld = the itemDelimiter
  169.   the itemDelimiter = TAB
  170.   member("questionText").text = item 1 of vsQuestionData
  171.   viSprite = mGiveDot(poDotMan)
  172.   AlignTextBoxToSpacer(viSprite, "questionSpacer")
  173.   set the member of sprite viSprite to "questionText"
  174.   set the ink of sprite viSprite to 36
  175.   viSprite = mGiveDots(poDotMan, piNumAnswers)
  176.   repeat with i = 1 to piNumAnswers
  177.     viNextSprite = viSprite + i - 1
  178.     vsNum = IntegerToString(i, pkMaxDigits)
  179.     member("answerText" & vsNum).text = item getAt(plAnswerOrder, i) + 1 of vsQuestionData
  180.     set the member of sprite viNextSprite to "answerText" & vsNum
  181.     AlignTextBoxToSpacer(viNextSprite, "answerSpacer" & vsNum)
  182.     set the ink of sprite viNextSprite to 36
  183.   end repeat
  184.   viSprite = mGiveDot(poDotMan)
  185.   set the member of sprite viSprite to "fromChapterText"
  186.   AlignTextBoxToSpacer(viSprite, "fromChapterSpacer")
  187. end
  188.  
  189. on mSetButtonState me
  190.   if pzEvalType = #test then
  191.     mSetState(poTop, #Up)
  192.     mSetState(poNext, #Up)
  193.     mDisable(poTop, 0)
  194.     mDisable(poNext, 0)
  195.     if piCurQuestion = 1 then
  196.       mSetState(poPrev, #gray)
  197.       mDisable(poPrev, 1)
  198.     else
  199.       mSetState(poPrev, #Up)
  200.       mDisable(poPrev, 0)
  201.     end if
  202.   else
  203.     if (piCurQuestion = 1) and voidp(poOwner) then
  204.       mSetState(poPrev, #gray)
  205.       mSetState(poTop, #gray)
  206.       mSetState(poNext, #gray)
  207.       mDisable(poPrev, 1)
  208.       mDisable(poTop, 1)
  209.       mDisable(poNext, 1)
  210.     else
  211.       mSetState(poPrev, #Up)
  212.       mSetState(poTop, #gray)
  213.       mSetState(poNext, #gray)
  214.       mDisable(poPrev, 0)
  215.       mDisable(poTop, 1)
  216.       mDisable(poNext, 1)
  217.     end if
  218.   end if
  219.   if (piCurQuestion <= count(plFirstAnswer)) and (piCurQuestion < piNumQuestions) then
  220.     mSetState(poNext, #Up)
  221.     mDisable(poNext, 0)
  222.   end if
  223. end
  224.  
  225. on mDisable me, xbDisable
  226.   mDisable(poPrev, xbDisable)
  227.   mDisable(poTop, xbDisable)
  228.   mDisable(poNext, xbDisable)
  229. end
  230.  
  231. on mHandleNumQuestions me, xiID
  232.   piNumQuestions = xiID
  233. end
  234.  
  235. on mHandleChapterSelectionClick me, xiChapter
  236.   piCurChapter = xiChapter
  237.   if mGetState(poTop) = #gray then
  238.     mSetState(poTop, #Up)
  239.     mDisable(poTop, 0)
  240.   end if
  241. end
  242.  
  243. on mHandlePrevBtnClick me, xOpcode
  244.   if piCurQuestion = 1 then
  245.     mNotify(poOwner, #mQuizToStage)
  246.   else
  247.     piCurQuestion = piCurQuestion - 1
  248.     plAnswerOrder = getAt(plQuestionsAnswerOrder, piCurQuestion)
  249.     if pzEvalType = #quiz then
  250.       piCurChapterQuestion = piCurQuestion
  251.       mStartNewQuestion(me, piCurQuestion, "ShowAnswer", "back", "next")
  252.     else
  253.       mStartNewTestQuestion(me)
  254.       mStartNewQuestion(me, piCurQuestion, "doneTest", "back", "next")
  255.     end if
  256.   end if
  257. end
  258.  
  259. on mInitQuestionData me
  260.   piCurQuestion = 1
  261.   piCurChapterQuestion = 1
  262.   piTotalCorrect = 0
  263.   plRightWrong = []
  264.   plQuestionsAnswerOrder = []
  265.   plFirstAnswer = []
  266.   member("fromChapterText").text = EMPTY
  267.   repeat with i = 1 to piNumQuestions
  268.     append(plRightWrong, EMPTY)
  269.     vlAnswerOrder = GetRandomListFrom1toX(piNumAnswers)
  270.     addAt(plQuestionsAnswerOrder, piCurQuestion, duplicate(vlAnswerOrder))
  271.   end repeat
  272.   plAnswerOrder = getAt(plQuestionsAnswerOrder, 1)
  273. end
  274.  
  275. on mHandleTopBtnClick me, xzTop
  276.   case xzTop of
  277.     #startquiz:
  278.       mInitQuestionData(me)
  279.       plQuestionOrder = GetRandomListFrom1toX(piNumQuestionsAvailable)
  280.       psChapterQuestions = member(IntegerToString(piCurChapter, pkMaxDigits)).text
  281.       mStartNewQuestion(me, 1, "ShowAnswer", "back", "next")
  282.     #starttest:
  283.       mInitQuestionData(me)
  284.       piNumTestQuestonsAnswered = 0
  285.       set the text of field "testRightScroll" to EMPTY
  286.       set the text of field "testWrongScroll" to EMPTY
  287.       mSelectTestQuestions(me)
  288.     #showAnswer:
  289.       viWhich = getPos(plAnswerOrder, 1)
  290.       viSprite = viWhich + piResponseSprites - 1
  291.       AlignCenteredSpriteToMember(viSprite, "markSpacer" & IntegerToString(viWhich, pkMaxDigits))
  292.       set the member of sprite viSprite to "right"
  293.     #donetest:
  294.       mDisplaySummary(me)
  295.     #quizSummary, #testSummary:
  296.       mDisplaySummary(me)
  297.     #newQuiz, #newTest:
  298.       pliTestChapters = []
  299.       set the text of field "curChoice" to "20"
  300.       set the text of field "testRightScroll" to EMPTY
  301.       set the text of field "testWrongScroll" to EMPTY
  302.       member("fromChapterText").text = EMPTY
  303.       deleteOne(the actorList, poRightQuestions)
  304.       deleteOne(the actorList, poWrongQuestions)
  305.       mInitSprites(me)
  306.       puppetTransition(3, 2, 2, 1)
  307.   end case
  308. end
  309.  
  310. on mSelectTestQuestions me
  311.   pliTestChapters = mGetChosenID(poChapterBtnGroup)
  312.   viNumChapters = count(pliTestChapters)
  313.   if (viNumChapters * piNumQuestionsAvailable) < piNumQuestions then
  314.     alert("You have choosen to many questions for the number of chapters selected.")
  315.   else
  316.     viQuestionsPerChapter = integer(piNumQuestions / viNumChapters)
  317.     viRemainder = piNumQuestions - (viQuestionsPerChapter * viNumChapters)
  318.     plQuestionOrder = GetRandomListFrom1toX(piNumQuestionsAvailable)
  319.     plTestQuestionOrder = GetRandomListFrom1toX(piNumQuestions)
  320.     plpTestQuestions = [:]
  321.     repeat with viChapter in pliTestChapters
  322.       if getPos(pliTestChapters, viChapter) <= viRemainder then
  323.         viNumQuestions = viQuestionsPerChapter + 1
  324.       else
  325.         viNumQuestions = viQuestionsPerChapter
  326.       end if
  327.       repeat with i = 1 to viNumQuestions
  328.         addProp(plpTestQuestions, viChapter, i)
  329.       end repeat
  330.     end repeat
  331.     mStartNewTestQuestion(me)
  332.     mStartNewQuestion(me, piCurQuestion, "doneTest", "back", "next")
  333.   end if
  334. end
  335.  
  336. on mHandleNextBtnClick me, xOpcode
  337.   if piCurQuestion < piNumQuestions then
  338.     piCurQuestion = piCurQuestion + 1
  339.     plAnswerOrder = getAt(plQuestionsAnswerOrder, piCurQuestion)
  340.     if pzEvalType = #quiz then
  341.       piCurChapterQuestion = piCurQuestion
  342.       mStartNewQuestion(me, piCurQuestion, "ShowAnswer", "back", "next")
  343.     else
  344.       mStartNewTestQuestion(me)
  345.       mStartNewQuestion(me, piCurQuestion, "doneTest", "back", "next")
  346.     end if
  347.   else
  348.     if voidp(poOwner) then
  349.       mDisplaySummary(me)
  350.     end if
  351.   end if
  352. end
  353.  
  354. on mStartNewTestQuestion me
  355.   piCurChapter = getPropAt(plpTestQuestions, getAt(plTestQuestionOrder, piCurQuestion))
  356.   piCurChapterQuestion = getAt(plpTestQuestions, getAt(plTestQuestionOrder, piCurQuestion))
  357.   psChapterQuestions = member(IntegerToString(piCurChapter, pkMaxDigits)).text
  358. end
  359.  
  360. on mStartNewQuestion me, xiNextQuestion, xsTop, xsPrev, xsNext
  361.   mResetDots(poDotMan)
  362.   mInitBkg(me, string(pzEvalType) & "QuestBg")
  363.   mInitButtons(me, xsTop, xsPrev, xsNext)
  364.   mSetButtonState(me)
  365.   mInitNumberFields(me)
  366.   mInitTextFields(me)
  367.   mInitLetters(me)
  368.   if pzEvalType = #quiz then
  369.     if count(plFirstAnswer) >= piCurQuestion then
  370.       viWhich = getAt(plFirstAnswer, piCurQuestion)
  371.       AlignCenteredSpriteToMember(piResponseSprites + viWhich - 1, "markspacer" & IntegerToString(viWhich, pkMaxDigits))
  372.       set the member of sprite (piResponseSprites + viWhich - 1) to getAt(plRightWrong, piCurQuestion)
  373.       mSetState(getAt(ploAnswerButtons, viWhich), #down)
  374.       mDisable(getAt(ploAnswerButtons, viWhich), 1)
  375.     end if
  376.   else
  377.     if count(plFirstAnswer) >= piCurQuestion then
  378.       viWhich = getAt(plFirstAnswer, piCurQuestion)
  379.       if viWhich then
  380.         mDepressABtn(poTestAnswer, viWhich)
  381.       end if
  382.     end if
  383.   end if
  384. end
  385.  
  386. on mReviewAQuestion me, xiNextQuestion
  387.   piCurQuestion = xiNextQuestion
  388.   if pzEvalType = #quiz then
  389.     piCurChapterQuestion = piCurQuestion
  390.   else
  391.     mStartNewTestQuestion(me)
  392.   end if
  393.   plAnswerOrder = getAt(plQuestionsAnswerOrder, piCurQuestion)
  394.   mStartNewQuestion(me, xiNextQuestion, string(pzEvalType) & "summary")
  395.   if pzEvalType = #test then
  396.     member("fromChapterText").text = "Chapter " & getPropAt(plpTestQuestions, piCurQuestion)
  397.     mDisable(poTestAnswer, 1)
  398.     if count(plFirstAnswer) >= piCurQuestion then
  399.       viWhich = getAt(plFirstAnswer, piCurQuestion)
  400.       AlignCenteredSpriteToMember(piResponseSprites + viWhich - 1, "markSpacer" & IntegerToString(viWhich, pkMaxDigits))
  401.       set the member of sprite (piResponseSprites + viWhich - 1) to getAt(plRightWrong, piCurQuestion)
  402.     end if
  403.   else
  404.     repeat with i = 1 to piNumAnswers
  405.       mDisable(getAt(ploAnswerButtons, i), 1)
  406.     end repeat
  407.   end if
  408.   if voidp(poOwner) then
  409.     mSetState(poTop, #Up)
  410.     mDisable(poTop, 0)
  411.   end if
  412.   mHandleTopBtnClick(me, #showAnswer)
  413. end
  414.  
  415. on mDisplaySummary me
  416.   mResetDots(poDotMan)
  417.   mInitBkg(me, string(pzEvalType) & "SummaryBG")
  418.   mInitButtons(me)
  419.   if pzEvalType = #quiz then
  420.     mInitReviewQuestionBtns(me)
  421.   else
  422.     mInitReviewScrollText(me)
  423.   end if
  424.   viSprite = mGiveDot(poDotMan)
  425.   member("total_correct").text = string(piTotalCorrect)
  426.   set the member of sprite viSprite to "total_correct"
  427.   AlignTextBoxToSpacer(viSprite, "summaryNumCorrectSpacer")
  428.   set the ink of sprite viSprite to 36
  429.   viSprite = mGiveDot(poDotMan)
  430.   if pzEvalType = #quiz then
  431.     member("total_correct_percentage").text = string(integer(100 * piTotalCorrect / piNumQuestions))
  432.   else
  433.     member("total_correct_percentage").text = string(integer(100 * piTotalCorrect / piNumQuestions))
  434.   end if
  435.   set the member of sprite viSprite to "total_correct_percentage"
  436.   AlignTextBoxToSpacer(viSprite, "summaryScoreSpacer")
  437.   set the ink of sprite viSprite to 36
  438. end
  439.  
  440. on mHandleAnswerClick me, xiID
  441.   if (piCurQuestion = piNumQuestions) and not voidp(poOwner) then
  442.     mSetState(poNext, #gray)
  443.     mDisable(poNext, 1)
  444.     mNotify(poOwner, #mDoneQuiz)
  445.   else
  446.     mSetState(poNext, #Up)
  447.     mDisable(poNext, 0)
  448.   end if
  449.   mSetState(poTop, #Up)
  450.   mDisable(poTop, 0)
  451.   mDisable(getAt(ploAnswerButtons, xiID), 1)
  452.   if getAt(plAnswerOrder, xiID) = 1 then
  453.     vsMember = "right"
  454.     puppetSound("legalDrag.snd")
  455.     viChange = 1
  456.   else
  457.     vsMember = "wrong"
  458.     puppetSound("illegalDrag.snd")
  459.     viChange = 0
  460.   end if
  461.   AlignCenteredSpriteToMember(piResponseSprites + xiID - 1, "markspacer" & IntegerToString(xiID, pkMaxDigits))
  462.   set the member of sprite (piResponseSprites + xiID - 1) to vsMember
  463.   if getAt(plRightWrong, piCurQuestion) = EMPTY then
  464.     setAt(plFirstAnswer, piCurQuestion, xiID)
  465.     setAt(plRightWrong, piCurQuestion, vsMember)
  466.     piTotalCorrect = piTotalCorrect + viChange
  467.     member("total_correct").text = string(piTotalCorrect)
  468.   end if
  469. end
  470.  
  471. on mHandleTestAnswerClick me, xiID
  472.   puppetSound("clickSnd")
  473.   if getAt(plAnswerOrder, xiID) = 1 then
  474.     vsMember = "right"
  475.     viChange = 1
  476.   else
  477.     vsMember = "wrong"
  478.     viChange = 0
  479.   end if
  480.   if getAt(plRightWrong, piCurQuestion) = EMPTY then
  481.     piNumTestQuestonsAnswered = piNumTestQuestonsAnswered + 1
  482.   end if
  483.   if getAt(plRightWrong, piCurQuestion) = "right" then
  484.     if viChange = 0 then
  485.       piTotalCorrect = piTotalCorrect - 1
  486.     end if
  487.   else
  488.     piTotalCorrect = piTotalCorrect + viChange
  489.   end if
  490.   setAt(plFirstAnswer, piCurQuestion, xiID)
  491.   setAt(plRightWrong, piCurQuestion, vsMember)
  492. end
  493.  
  494. on mHandleQuestionReview me, xiQuestion
  495.   mReviewAQuestion(me, xiQuestion)
  496. end
  497.  
  498. on mHandleScrollingList me, xiID
  499.   if xiID = 1 then
  500.     vsLine = mGetLine(poRightQuestions)
  501.   else
  502.     vsLine = mGetLine(poWrongQuestions)
  503.   end if
  504.   vsNum = char offset(" ", vsLine) + 1 to offset("-", vsLine) - 2 of vsLine
  505.   mHide(poRightQuestions)
  506.   mHide(poWrongQuestions)
  507.   mReviewAQuestion(me, integer(vsNum))
  508.   deleteOne(the actorList, poRightQuestions)
  509.   deleteOne(the actorList, poWrongQuestions)
  510. end
  511.  
  512. on mNotify me, xiEvent, xOpcode
  513.   case xiEvent of
  514.     #mPrevBtnClick:
  515.       mHandlePrevBtnClick(me, xOpcode)
  516.     #mTopBtnClick:
  517.       mHandleTopBtnClick(me, xOpcode)
  518.     #mNextBtnClick:
  519.       mHandleNextBtnClick(me, xOpcode)
  520.     #chapterSelectionClick:
  521.       mHandleChapterSelectionClick(me, xOpcode)
  522.     #answerClick:
  523.       mHandleAnswerClick(me, xOpcode)
  524.     #testAnswer:
  525.       mHandleTestAnswerClick(me, xOpcode)
  526.     #questionReview:
  527.       mHandleQuestionReview(me, xOpcode)
  528.     #numQuestionsRadioBtn:
  529.       mHandleNumQuestions(me, xOpcode)
  530.     #scrollingList:
  531.       mHandleScrollingList(me, xOpcode)
  532.   end case
  533. end
  534.  
  535. on cleanUp me
  536.   plQuestionOrder = []
  537.   plAnswerOrder = []
  538.   plRightWrong = []
  539.   ploAnswerButtons = []
  540.   plQuestionsAnswerOrder = []
  541.   plFirstAnswer = []
  542.   ploTestChapterButtons = []
  543.   pliTestChapters = []
  544.   poPopUp = VOID
  545.   plpTestQuestions = []
  546.   plTestQuestionOrder = []
  547.   poRightQuestions = VOID
  548.   poWrongQuestions = VOID
  549. end
  550.